package Controllers;

import Models.*;
import java.util.ArrayList;

/**
 * @author Morten
 */
public class CustomerCTR
{
    private CustomerCollection customers;

    public CustomerCTR()
    {
        this.customers = CustomerCollection.getInstance();
    }
    
    public Customer addPrivateCustomer(String name, String address, int zipcode, String city, int phoneNo)
    {
		PrivateCustomer pCustomer = new PrivateCustomer(name, address, zipcode, city, phoneNo);
		this.customers.addCustomer(pCustomer);
		return pCustomer;
    }

    public Customer addBusinessCustomer(String companyName, String contact, int cvr, String address, int zipcode, String city, int phoneNo)
    {
        BusinessCustomer bCustomer = new BusinessCustomer(companyName, contact, cvr, address, zipcode, contact, phoneNo);
		this.customers.addCustomer(bCustomer);
        return bCustomer;
    }

    public ArrayList<Customer> findCustomer(String address, int zipcode, String city, int phoneNo, String name, String contact, int cvr)
    {
        return this.customers.findCustomer(address, zipcode, city, phoneNo, name, contact, cvr);
    }

    public Customer getCustomer(int id)
    {
        return this.customers.getCustomer(id);
    }

	public ArrayList<Customer> getAllCustomers()
	{
		return this.customers.getAllCustomers();
	}

    public void removeCustomer(Customer customer)
    {
        this.customers.removeCustomer(customer);
    }
    
}